<script setup>
import zh from 'ant-design-vue/locale/zh_CN'
import menus from './assets/raw/menu.json'
import {useRouter} from "vue-router";

const router = useRouter();

function handleRoute(routeName) {
  router.push({ name: routeName })
}
</script>

<template>
  <a-app>
    <a-config-provider :locale="zh">
      <a-layout class="h-100v" has-sider>
        <a-layout-sider collapsed theme="light">
          <a-menu>
            <a-menu-item @click="handleRoute(item.routeName)" v-for="item in menus" :key="item.title">
              <template #icon>
                <component :is="item.icon"/>
              </template>
              <template #title>
                {{ item.title }}
              </template>
            </a-menu-item>
          </a-menu>
        </a-layout-sider>
        <a-layout-content>
          <router-view/>
        </a-layout-content>
      </a-layout>
    </a-config-provider>
  </a-app>
</template>

<style scoped>

</style>
